% 按钮的使用
h0=figure('toolbar','none','position',[200 150 450 250],'name','实例32');
x=0:0.5:2*pi;
y=sin(x);
plot(x,y)
huidiao1=[...
        'set(h_toggle2,''value'',0),',...
        'grid on,',...
        ];
huidiao2=[...
        'set(h_toggle1,''value'',0),',...
        'grid off,',...
        ];
h_toggle1=uicontrol(gcf,'style','togglebutton',...
    'string','grid on',...
    'value',0,...
    'position',[20 45 50 20],...
    'callback',huidiao1);

h_toggle2=uicontrol(gcf,'style','togglebutton',...
    'string','grid off',...
    'value',0,...
    'position',[20 20 50 20],...
    'callback',huidiao2);
set(gca,'position',[0.2 0.2 0.6 0.6])
title('开关按钮的使用')
saveas(h0,'32_开关按钮的使用.png')
